1. Field of the Invention
The present invention relates to a microcomputer containing a flash memory (EEPROM).
2. Description of the Related Art
A 1-chip microcomputer comprises a program memory (non-volatile memory) integrated over a single chip. A mask ROM, EPROM, EEPROM or such like is used as the program memory.
(1) Mask ROM
This has the advantages that production can be increased and chip area can be reduced by manufacturing a plurality of masks in one batch. However, there is the disadvantage that a plurality of masks have to be re-manufactured in order to perform reprogramming, requiring considerable manufacturing time and making it impossible to perform reprogramming quickly.
(2) EPROM
An EPROM has the advantage that quick reprogramming is possible by ultra-violetly erasing present data and writing new data. However, it has the disadvantage that since all present data are ultra-violetly erased, those data which have been erased unnecessarily must be rewritten.
(3) EEPROM
An EEPROM has the advantage that quick reprogramming is possible by electrically erasing present data and writing new data. In addition, since present data can be partially erased, data which do not need to be erased can be retained.
Recent 1-chip microcomputers mostly tend to contain an EEPROM thereby utilizing the advantages of all the above non-volatile memories. The EEPROM is used as a program memory to control the operation of the 1-chip microcomputer.
Here, the address regions of the EEPROM are deemed to consist of a first address region treated similarly to a mask ROM in which data are not rewritten and a second address region in which data are rewritten as necessary.
Data which have already been written in the EEPROM can be electrically erased. However, since the first address region is treated similarly to a mask ROM, mistaken operations such as the erasure of data in the first address region when the 1-chip microcomputer is operated must be prohibited.
However, there has been the problem that when the 1-chip microcomputer is connected to an external device and address data are supplied from the external device to the first address region of the EEPROM contained in the 1-chip microcomputer, the first address region program of the EEPROM is partially altered causing the 1-chip microcomputer to perform mistaken operations.
Furthermore, depending on the type of external device used, there are cases in which the 1-chip microcomputer cannot be applied unless the first address region of the EEPROM is enlarged. This has led to the problem that the application range of the 1-chip microcomputer is limited.
When an external device not envisaged beforehand is to be additionally connected to the 1-chip microcomputer, a program must be written for enlarging the first address region to enable an external device to be connected and for writing a program for the external device to be added in the second address region. This additional program writes an operation program for operations using the external device in the second address region.